From e510765e70d882b5dc7b3ddc4226a38b34e6534a Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 2 Dec 2009 18:41:31 +0000 Subject: [PATCH] libxenlight: fix dm_xenstore_record_pid The function dm_xenstore_record_pid is executed by a child of the main process and therefore shouldn't use the same xenstore connection: currently it opens a new connection but still uses the old one. Signed-off-by: Stefano Stabellini --- tools/libxl/libxl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 8d4411f613..ec75ca0af3 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -663,10 +663,10 @@ void dm_xenstore_record_pid(struct libxl_ctx *ctx, void *for_spawn, /* we mustn't use the parent's handle in the child */ kvs[0] = "image/device-model-pid"; - kvs[1] = libxl_sprintf(ctx, "%d", innerchild); + kvs[1] = libxl_sprintf(&clone, "%d", innerchild); kvs[2] = NULL; - rc = libxl_xs_writev(ctx, XBT_NULL, starting->dom_path, kvs); - if (rc) XL_LOG_ERRNO(ctx, XL_LOG_ERROR, + rc = libxl_xs_writev(&clone, XBT_NULL, starting->dom_path, kvs); + if (rc) XL_LOG_ERRNO(&clone, XL_LOG_ERROR, "Couldn't record device model pid %ld at %s/%s", (unsigned long)innerchild, starting->dom_path, kvs); xs_daemon_close(clone.xsh); -- 2.30.2